home *** CD-ROM | disk | FTP | other *** search
- ;AGA Picture
- ;-----------
- ;Fades in a 32 colour AGA picture (24 bit colour). And then fades it out.
- ;
- ;Press left mouse button to exit.
-
- opt o+
-
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- LOCAL = 0
-
- SECTION "AGA_Screen",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l ($4).w,a6
- lea GMS_Name(pc),a1
- moveq #$00,d0
- CALL OpenLibrary
- move.l d0,GMS_Base
- beq.s Quit
-
- move.l GMS_Base(pc),a6 ;Initialise our screen.
- lea ScreenStruct(pc),a0
- CALL Add_Screen
- tst.l d0
- bne.s Error
-
- move.l SS_MemPtr1(a0),a1 ;Destination = SS_MemPtr1.
- lea PackedPicFile(pc),a0 ;File Name.
- CALL QuickLoad
- tst.l d0
- beq.s Error
-
- lea ScreenStruct(pc),a0 ;Unpack the data on top of itself.
- move.l SS_MemPtr1(a0),a1
- move.l a1,a0
- moveq #$00,d0
- CALL SmartUnpack
-
- lea ScreenStruct(pc),a0 ;Now show the screen/pic.
- CALL Show_Screen
-
- ;===========================================================================;
- ; MAIN CODE
- ;===========================================================================;
-
- .FadeIn CALL Wait_OSVBL
- moveq #1,d0 ;d0 = Speed of fade.
- lea ScreenPalette(pc),a1
- CALL B24_FadeToPalette ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s .FadeIn ;If not, keep doing it.
-
- CALL Wait_LMB
-
- .FadeOut
- CALL Wait_OSVBL
- moveq #2,d0 ;d0 = Speed of fade.
- CALL B24_FadeToBlack ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s .FadeOut ;If not, keep doing it.
-
- ;===========================================================================;
- ; RETURN TO DOS
- ;===========================================================================;
-
- CALL Delete_Screen ;Give back screen memory etc.
- Error move.l ($4).w,a6
- move.l GMS_Base(pc),a1
- CALL CloseLibrary
- Quit MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #$00,d0
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 5
-
- ScreenStruct:
- dc.l "GSV1"
- dc.l 0,0,0 ;Screen_Mem1/2/3
- dc.l 0 ;Screen link.
- dc.l 0 ;ScreenPalette ;Address of palette.
- dc.l 0 ;Address of rasterlist.
- dc.l 0 ;Amt of colours in palette.
- dc.w 256,320,320/8 ;Screen Height, Width, Width/8
- dc.w 256,320,320/8 ;Pic Height, Width, Width/8
- dc.w AMT_PLANES ;Amt of planes.
- dc.w 0,0 ;Top of screen offsets, X/Y
- dc.w 0 ;Scroll buffer in pixels/8.
- dc.w 0,0 ;X/Y counters (for scrolling).
- dc.l NOBURST ;Special attributes.
- dc.w LORES|_24BITCOL ;Screen mode.
- dc.b INTERLEAVED ;Screen type
- dc.b 0 ;Screen Is Being Displayed?
- dc.l 0,0 ;Reserved area.
- even
-
- ScreenPalette:
- dc.l $000000,$080808,$101010,$191919
- dc.l $212121,$292929,$313131,$3A3A3A
- dc.l $424242,$4A4A4A,$525252,$5A5A5A
- dc.l $636363,$6B6B6B,$737373,$7B7B7B
- dc.l $848484,$8C8C8C,$949494,$9C9C9C
- dc.l $A5A5A5,$ADADAD,$B5B5B5,$BDBDBD
- dc.l $C5C5C5,$CECECE,$D6D6D6,$7F7F7F
- dc.l $9B9B9B,$707070,$444444,$1E1E1E
-
- PackedPicFile:
- IFNE LOCAL
- dc.b "GAMESLIB:Demos/"
- ENDC
- dc.b "data/AGAPic32.pak",0
- even
-